Skip to content

Ignore .pytest_cache/.#16595

Merged
taleinat merged 1 commit into
python:masterfrom
brandtbucher:ignore-pytest-cache
Nov 15, 2019
Merged

Ignore .pytest_cache/.#16595
taleinat merged 1 commit into
python:masterfrom
brandtbucher:ignore-pytest-cache

Conversation

@brandtbucher

Copy link
Copy Markdown
Member

Keeps my plugin from sneaking JSON files into commits.

@brandtbucher

Copy link
Copy Markdown
Member Author

Not sure how/if this should be backported.

@ammaraskar

Copy link
Copy Markdown
Member

Sorry if I'm missing something but which plugin are you referring to? Was it added to the workflow recently?

AFAIK we don't use or endorse pytest in cpython development.

@brandtbucher

Copy link
Copy Markdown
Member Author

@ammaraskar The Python plugin for Visual Studio Code generates these caches when the project is opened. I figured that since caches for other “unofficial” tools like .mypy_cache/ and .vscode/ are included here, it could be good to add.

Not a huge deal, but could be helpful to others.

@ammaraskar

Copy link
Copy Markdown
Member

Sounds good 👍

Maybe group up the vscode related ones and put a comment there just so people know why?

@brandtbucher

Copy link
Copy Markdown
Member Author

Well, this is a pytest cache, not a VSCode cache. The plugin just happens to trigger it (.mypy_cache/ is the same).

@taleinat

Copy link
Copy Markdown
Contributor

The Python plugin creates .pytest_cache directories for projects not using pytest? Sounds like a bug in the plugin! (And if it's this plugin that caused the addition of .mypy_cache to our .gitignore, maybe that should be fixed too...)

@merwok

merwok commented Nov 14, 2019

Copy link
Copy Markdown
Member

mypy cache is an older manual addition: #6614

Is is possible to run (some) CPython tests with pytest? If not, an IDE plugin dumping things to all your projects uncontrollably does not seem good.

@brandtbucher

Copy link
Copy Markdown
Member Author

It is possible. In fact, I've used pytest in the past to get nice iterative output, with something like pytest Lib/test/test_glob.py --looponfail.

Again, this is just a suggestion. I can always add it to my personal ignore file, but I figured if it was useful for me, it might be useful for others!

@taleinat taleinat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at our .gitignore, it's obvious the current policy is to add everything that is common enough to be useful to many people. So if someone wants this, and there's surely no possible harm, I don't see why not :)

@taleinat

Copy link
Copy Markdown
Contributor

Not sure how/if this should be backported.

Since the vast majority of development is done based on the master branch, I don't think it is worth backporting this.

@taleinat taleinat merged commit 57d3ab8 into python:master Nov 15, 2019
@brandtbucher

Copy link
Copy Markdown
Member Author

Thanks @taleinat!

jacobneiltaylor pushed a commit to jacobneiltaylor/cpython that referenced this pull request Dec 5, 2019
shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Jan 31, 2020
@brandtbucher brandtbucher deleted the ignore-pytest-cache branch July 21, 2022 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants